package com.jl.jlapp.mvp.activity;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.RadioButton;
import android.widget.TextView;
import android.widget.Toast;

import butterknife.BindView;
import butterknife.ButterKnife;

import com.jl.jlapp.R;
import com.jl.jlapp.eneity.CommitVatInvoiceAptitudeToCheckModel;
import com.jl.jlapp.nets.Api;
import com.jl.jlapp.nets.CommonObserver;
import com.jl.jlapp.nets.Net;
import com.jl.jlapp.nets.Transformer;
import com.jl.jlapp.utils.Tools;

import io.reactivex.Flowable;
import io.reactivex.android.schedulers.AndroidSchedulers;
import io.reactivex.schedulers.Schedulers;

public class PayResultActivity
        extends Activity {
    @BindView(R.id.rb_left)
    RadioButton returnHomePage;
    @BindView(R.id.rb_right)
    RadioButton seeOrder;
    @BindView(R.id.tv_result)
    TextView tvResult;
    @BindView(R.id.tv_succsess_num)
    TextView tvSuccessNum;

    protected void onCreate(Bundle paramBundle) {
        super.onCreate(paramBundle);
        setContentView(R.layout.activity_result_pay);
        ButterKnife.bind(this);
        Tools.finishAll();
        Intent intent = getIntent();
        String str = intent.getStringExtra("orderNo");
        final int i = intent.getIntExtra("orderId", -1);
        int j = intent.getIntExtra("page", 0);
        if ((str != null) && (str != "") && (i != -1) && (j == 1)) {
            this.tvResult.setText("提交成功");
            this.tvSuccessNum.setText("您的订单(订单号:" + str + ")已提交成功,正在审核。");
            this.returnHomePage.setOnClickListener(new OnClickListener() {
                public void onClick(View paramAnonymousView) {
                    Intent intent1 = new Intent(PayResultActivity.this, BaseActivity.class);
                    intent1.putExtra("shouldReplaceFragment", 0);
                    PayResultActivity.this.startActivity(intent1);
                }
            });
            this.seeOrder.setOnClickListener(new OnClickListener() {
                public void onClick(View paramAnonymousView) {
                    Intent intent1 = new Intent(PayResultActivity.this, OrderDetailActivity.class);
                    intent1.putExtra("orderId", i);
                    PayResultActivity.this.startActivity(intent1);
                }
            });
            return;
        }
        if ((str != null) && (str != "") && (i != -1) && (j == 0)) {
            Net.get().shoppingBackCouponToUser(i)
                    .compose(Transformer.<CommitVatInvoiceAptitudeToCheckModel>switchSchedulers())
                    .subscribe(new CommonObserver<CommitVatInvoiceAptitudeToCheckModel>() {
                        @Override
                        protected void onError(String errorMsg) {

                        }

                        @Override
                        protected void onSuccess(CommitVatInvoiceAptitudeToCheckModel commitVatInvoiceAptitudeToCheckModel) {

                        }
                    });
            this.tvSuccessNum.setText("您的订单(订单号:" + str + ")已支付成功并提交仓库备货");
            this.returnHomePage.setOnClickListener(new OnClickListener() {
                public void onClick(View paramAnonymousView) {
                    Intent intent1 = new Intent(PayResultActivity.this, BaseActivity.class);
                    intent1.putExtra("shouldReplaceFragment", 0);
                    PayResultActivity.this.startActivity(intent1);
                }
            });
            this.seeOrder.setOnClickListener(new OnClickListener() {
                public void onClick(View paramAnonymousView) {
                    Intent intent1 = new Intent(PayResultActivity.this, OrderDetailActivity.class);
                    intent1.putExtra("orderId", i);
                    PayResultActivity.this.startActivity(intent1);
                }
            });
            return;
        }
        Toast.makeText(this, "页面传值错误", Toast.LENGTH_SHORT).show();
    }
}


/* Location:              /Users/davidzhang/Documents/decompileApk/jlfood-dex2jar.jar!/com/jl/jlapp/mvp/activity/PayResultActivity.class
 * Java compiler version: 6 (50.0)
 * JD-Core Version:       0.7.1
 */